package com.tmz.cloudmall.cloudmallorder.service.impl;

import java.util.List;

import com.tmz.cloudmall.cloudmallcommon.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tmz.cloudmall.cloudmallorder.mapper.ReturnApplyMapper;
import com.tmz.cloudmall.cloudmallorder.domain.ReturnApply;
import com.tmz.cloudmall.cloudmallorder.service.IReturnApplyService;

/**
 * 退货申请Service业务层处理
 * 
 * @author tmz
 * @date 2025-08-16
 */
@Service
public class ReturnApplyServiceImpl implements IReturnApplyService 
{
    @Autowired
    private ReturnApplyMapper returnApplyMapper;

    /**
     * 查询退货申请
     * 
     * @param id 退货申请主键
     * @return 退货申请
     */
    @Override
    public ReturnApply selectReturnApplyById(Long id)
    {
        return returnApplyMapper.selectReturnApplyById(id);
    }

    /**
     * 查询退货申请列表
     * 
     * @param returnApply 退货申请
     * @return 退货申请
     */
    @Override
    public List<ReturnApply> selectReturnApplyList(ReturnApply returnApply)
    {
        return returnApplyMapper.selectReturnApplyList(returnApply);
    }

    /**
     * 新增退货申请
     * 
     * @param returnApply 退货申请
     * @return 结果
     */
    @Override
    public int insertReturnApply(ReturnApply returnApply)
    {
        returnApply.setCreateTime(DateUtils.getNowDate());
        return returnApplyMapper.insertReturnApply(returnApply);
    }

    /**
     * 修改退货申请
     * 
     * @param returnApply 退货申请
     * @return 结果
     */
    @Override
    public int updateReturnApply(ReturnApply returnApply)
    {
        return returnApplyMapper.updateReturnApply(returnApply);
    }

    /**
     * 批量删除退货申请
     * 
     * @param ids 需要删除的退货申请主键
     * @return 结果
     */
    @Override
    public int deleteReturnApplyByIds(Long[] ids)
    {
        return returnApplyMapper.deleteReturnApplyByIds(ids);
    }

    /**
     * 删除退货申请信息
     * 
     * @param id 退货申请主键
     * @return 结果
     */
    @Override
    public int deleteReturnApplyById(Long id)
    {
        return returnApplyMapper.deleteReturnApplyById(id);
    }
}
